package com.ljs.shardingspheredemo.config.algorithm;

import org.apache.shardingsphere.api.sharding.standard.RangeShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.RangeShardingValue;

import java.util.Arrays;
import java.util.Collection;

public class MyRangeDatabaseShardingalgorithm implements RangeShardingAlgorithm<Long> {
@Override
public Collection<String> doSharding(Collection<String> collection, RangeShardingValue<Long> rangeShardingValue){
        String logicTableName=rangeShardingValue.getLogicTableName();
// String userId=rangeShardingValue.getColumnName();
        Long lowerEndpoint=rangeShardingValue.getValueRange().lowerEndpoint();//下限
        Long upperEndpoint=rangeShardingValue.getValueRange().upperEndpoint();//上限
        //有库m1,m2
        return Arrays.asList("m1","m2");

        }
        }

